<% userDetail = resData.userDetail %>
<% isPassword = userDetail.password %>
<div class="my-page setting captureElem">
    <div class="content layui-row">
        <nav class="layui-col-md3 my-page-nav">
            <div class="item"><a href="/my/record">投递记录</a></div>
            <div class="item"><a href="/my/collect">职位收藏</a></div>
            <div class="item"><a class="active" href="/my/setting">账号设置</a></div>
        </nav>
        <div class="layui-col-md9 my-page-cnt">
            <input type="hidden" class="userID" value="<%= userDetail.id %>">
            <h3 class="title">账号设置</h3>
            <section class="filter">
                <a href="#account" class="account active">账号信息</a>
                <% if(isPassword){ %>
                    <a href="#change" class="change last">修改密码</a>
                <% }else { %>
                    <a href="#submit" class="submit last">设置密码</a>
                <% } %>
            </section>
            <div class="section">
                <section class="account-info account">
                    <div class="layui-row">
                        <div class="layui-col-md4">头像</div>
                        <div class="layui-col-md8">
                            <img class="user-head userHead"
                                 title="点击查看大图"
                                 src="<%= userDetail.picturePath ? userDetail.picturePath : '/public/images/user-head.png' %>" alt="">
                            <a class="uploadImage"
                               href="javascript:;"
                               data-tips="仅支持png/jpg/jpeg/gif格式图片，大小不超过5M"
                               onmouseenter="layer.tips(this.getAttribute('data-tips'), '.uploadImage', {tips: 1, time: 30000})"
                               onmouseleave="$('.layui-layer-tips').remove()">重新上传</a>
                            <label for="uploadImageFile" class="hidden">
                                <input type="file" class="uploadImageFile" accept="image/gif,image/png,image/jpg,image/jpeg">
                            </label>
                        </div>
                    </div>
                    <div class="layui-row">
                        <div class="layui-col-md4">昵称</div>
                        <div class="layui-col-md8">
                            <% if(userDetail.nickName){ %>
                                <span><%= userDetail.nickName %></span>
                                <a class="updateBind" href="javascript:;" data-id="bindingNicknameTempt">修改</a>
                            <% }else{ %>
                                <form class="layui-form">
                                    <div class="layui-form-item">
                                        <div class="title">昵称</div>
                                        <input type="text" name="nickname" placeholder="昵称可由中文、字母和数字组合，长度4-20位" autocomplete="off" class="layui-input">
                                    </div>
                                    <div class="layui-form-item">
                                        <button class="layui-btn confirm_bind_nickname" type="button">确定</button>
                                        <button class="layui-btn layui-btn-primary cancel_form" type="button">取消</button>
                                    </div>
                                </form>
                            <% } %>
                        </div>
                    </div>
                    <div class="layui-row">
                        <div class="layui-col-md4">绑定手机号</div>
                        <div class="layui-col-md8">
                            <% if(userDetail.telephone){ %>
                                <span><%= userDetail.telephone %></span>
                                <a class="updateBind" href="javascript:;" data-id="bindingPhoneTempt">修改</a>
                            <% }else{ %>
                                <form class="layui-form">
                                    <div class="layui-form-item">
                                        <div class="title">手机号</div>
                                        <input type="text" placeholder="请输入手机号" autocomplete="off" class="layui-input validateInput">
                                    </div>
                                    <div class="layui-form-item">
                                        <div class="title">手机验证码</div>
                                        <input type="text" placeholder="请输入验证码" autocomplete="off" class="layui-input min validateCode">
                                        <button class="layui-btn min validateCodeBtn" type="button" data-type="1">获取验证码</button>
                                    </div>
                                    <div class="layui-form-item">
                                        <button class="layui-btn confirmBindBtn" type="button" data-type="1">确定</button>
                                        <button class="layui-btn layui-btn-primary cancel_form" type="button">取消</button>
                                    </div>
                                </form>
                            <% } %>
                        </div>
                    </div>
                    <div class="layui-row">
                        <div class="layui-col-md4">绑定邮箱</div>
                        <div class="layui-col-md8">
                            <% if(userDetail.email){ %>
                                <span><%= userDetail.email %></span>
                                <a class="updateBind" href="javascript:;" data-id="bindingEmailTempt">修改</a>
                            <% }else{ %>
                                <form class="layui-form">
                                    <div class="layui-form-item">
                                        <div class="title">邮箱地址</div>
                                        <input type="text" required placeholder="请输入邮箱" autocomplete="off" class="layui-input validateInput">
                                    </div>
                                    <div class="layui-form-item">
                                        <div class="title">邮箱验证码</div>
                                        <input type="text" required placeholder="请输入验证码" autocomplete="off" class="layui-input min validateCode">
                                        <button class="layui-btn min validateCodeBtn" type="button" data-type="2">获取验证码</button>
                                    </div>
                                    <div class="layui-form-item">
                                        <button class="layui-btn confirmBindBtn" type="button" data-type="2">确定</button>
                                        <button class="layui-btn layui-btn-primary cancel_form" type="button">取消</button>
                                    </div>
                                </form>
                            <% } %>
                        </div>
                    </div>
                    <div class="layui-row">
                        <div class="layui-col-md4">关注公众号</div>
                        <div class="layui-col-md8">
                            <div class="tip">扫码关注51语言服务号，更多职业机会与精彩内容不容错过！</div>
                            <img src="/public/images/51yuyan_gzh.jpg" width="120" alt="">
                        </div>
                    </div>
                </section>
                <% if(isPassword){ %>
                    <section class="password change hidden">
                        <form class="layui-form">
                            <div class="layui-form-item">
                                <div class="title">输入原密码</div>
                                <input type="password" name="oldPassword" required lay-verify="required" placeholder="请输入原密码" autocomplete="off" class="layui-input">
                                <i class="pwd-icon-close togglePwdEye"></i>
                            </div>
                            <div class="layui-form-item">
                                <div class="title">输入新密码</div>
                                <input type="password" name="newPassword" required lay-verify="newPassword" placeholder="请输入6-20位密码" autocomplete="off" class="layui-input">
                                <i class="pwd-icon-close togglePwdEye"></i>
                            </div>
                            <div class="layui-form-item">
                                <div class="title">确认新密码</div>
                                <input type="password" name="reNewPassword" required lay-verify="reNewPassword" placeholder="请确认新密码" autocomplete="off" class="layui-input">
                                <i class="pwd-icon-close togglePwdEye"></i>
                            </div>
                            <div class="layui-form-item">
                                <button class="layui-btn" type="button" lay-submit lay-filter="confirm_change_pwd">确定</button>
                            </div>
                        </form>
                    </section>
                <% }else { %>
                    <section class="password submit hidden">
                        <form class="layui-form">
                            <div class="layui-form-item msg">你还未设置登录密码，请在此处设置你的登录密码！</div>
                            <div class="layui-form-item">
                                <div class="title">设置登录密码</div>
                                <input type="password" name="newPassword" required lay-verify="newPassword" placeholder="请输入6-20位密码" autocomplete="off" class="layui-input">
                                <i class="pwd-icon-close togglePwdEye"></i>
                            </div>
                            <div class="layui-form-item">
                                <div class="title">再次确认密码</div>
                                <input type="password" name="reNewPassword" required lay-verify="reNewPassword" placeholder="请再次确认密码" autocomplete="off" class="layui-input">
                                <i class="pwd-icon-close togglePwdEye"></i>
                            </div>
                            <div class="layui-form-item">
                                <button class="layui-btn" type="button" lay-submit lay-filter="confirm_submit_pwd">确定</button>
                            </div>
                        </form>
                    </section>
                <% } %>
            </div>
        </div>
    </div>
</div>
<script type="text/html" id="bindingNicknameTempt">
    <form class="layui-form">
        <div class="layui-form-item">
            <div class="title">昵称</div>
            <input type="text" name="nickname" placeholder="昵称可由中文、字母和数字组合，长度4-20位" autocomplete="off" class="layui-input">
        </div>
        <div class="layui-form-item">
            <button class="layui-btn confirm_bind_nickname" type="button">确定</button>
            <button class="layui-btn layui-btn-primary cancel_form" type="button">取消</button>
        </div>
    </form>
</script>
<script type="text/html" id="bindingPhoneTempt">
    <form class="layui-form">
        <div class="layui-form-item">
            <div class="title">手机号</div>
            <input type="text" placeholder="请输入手机号" autocomplete="off" class="layui-input validateInput">
        </div>
        <div class="layui-form-item">
            <div class="title">手机验证码</div>
            <input type="text" placeholder="请输入验证码" autocomplete="off" class="layui-input min validateCode">
            <button class="layui-btn min validateCodeBtn" type="button" data-type="1">获取验证码</button>
        </div>
        <div class="layui-form-item">
            <button class="layui-btn confirmBindBtn" type="button" data-type="1">确定</button>
            <button class="layui-btn layui-btn-primary cancel_form" type="button">取消</button>
        </div>
    </form>
</script>
<script type="text/html" id="bindingEmailTempt">
    <form class="layui-form">
        <div class="layui-form-item">
            <div class="title">邮箱地址</div>
            <input type="text" required placeholder="请输入邮箱" autocomplete="off" class="layui-input validateInput">
        </div>
        <div class="layui-form-item">
            <div class="title">邮箱验证码</div>
            <input type="text" required placeholder="请输入验证码" autocomplete="off" class="layui-input min validateCode">
            <button class="layui-btn min validateCodeBtn" type="button" data-type="2">获取验证码</button>
        </div>
        <div class="layui-form-item">
            <button class="layui-btn confirmBindBtn" type="button" data-type="2">确定</button>
            <button class="layui-btn layui-btn-primary cancel_form" type="button">取消</button>
        </div>
    </form>
</script>
<script type="text/javascript" src="/public/js/modules/my.js"></script>
<script type="text/javascript">
    gb_config_obj.init_setting()
</script>